<% layout('/layouts/default.html', {title: '进料检验管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('进料检验管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('st:stCheckLog:edit')){ %>
					<a href="${ctx}/st/stCheckLog/form" class="btn btn-default btnTool" title="${text('新增进料检验')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${stCheckLog}" action="${ctx}/st/stCheckLog/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('单据号')}：</label>
					<div class="control-inline">
						<#form:input path="billNo" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('单据日期')}：</label>
					<div class="control-inline">
						<#form:input path="billDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('检验人编码')}：</label>
					<div class="control-inline">
						<#form:input path="checkManCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('检验人')}：</label>
					<div class="control-inline">
						<#form:input path="checkMan" maxlength="5" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('不良数')}：</label>
					<div class="control-inline">
						<#form:input path="badNum" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('检验状态')}：</label>
					<div class="control-inline width-120">
						<#form:select path="checkState" dictType="st_check_state" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('供应商')}：</label>
					<div class="control-inline">
						<#form:input path="supplierId" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('源单号')}：</label>
					<div class="control-inline">
						<#form:input path="sourceBillNo" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('物料名称')}：</label>
					<div class="control-inline">
						<#form:input path="materialName" maxlength="36" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('采购数量')}：</label>
					<div class="control-inline">
						<#form:input path="buyNumber" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('待检数量')}：</label>
					<div class="control-inline">
						<#form:input path="waitCheckNumber" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('检验方式')}：</label>
					<div class="control-inline width-120">
						<#form:select path="checkType" dictType="st_check_type" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('送货数量')}：</label>
					<div class="control-inline">
						<#form:input path="sendNumber" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('允入数量')}：</label>
					<div class="control-inline">
						<#form:input path="stockInNumber" maxlength="8" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('批次')}：</label>
					<div class="control-inline">
						<#form:input path="batchNumber" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('包装规格')}：</label>
					<div class="control-inline">
						<#form:input path="packType" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('生产日期')}：</label>
					<div class="control-inline">
						<#form:input path="productDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('保质期')}：</label>
					<div class="control-inline">
						<#form:input path="savedType" maxlength="3" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('过期日期')}：</label>
					<div class="control-inline">
						<#form:input path="passDate" readonly="true" maxlength="20" class="form-control laydate width-datetime"
							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('生产厂家')}：</label>
					<div class="control-inline width-120">
						<#form:select path="productMaker" dictType="st_product_maker" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('部门编码')}：</label>
					<div class="control-inline">
						<#form:input path="deptCode" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('部门')}：</label>
					<div class="control-inline">
						<#form:input path="deptName" maxlength="20" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('异常描述')}：</label>
					<div class="control-inline">
						<#form:input path="exceptionDesc" maxlength="500" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('检验描述')}：</label>
					<div class="control-inline">
						<#form:input path="checkDesc" maxlength="500" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("单据号")}', name:'billNo', index:'a.bill_no', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/st/stCheckLog/form?id='+row.id+'" class="btnList" data-title="${text("编辑进料检验")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("单据日期")}', name:'billDate', index:'a.bill_date', width:150, align:"center"},
		{header:'${text("检验人编码")}', name:'checkManCode', index:'a.check_man_code', width:150, align:"left"},
		{header:'${text("检验人")}', name:'checkMan', index:'a.check_man', width:150, align:"left"},
		{header:'${text("不良数")}', name:'badNum', index:'a.bad_num', width:150, align:"center"},
		{header:'${text("检验状态")}', name:'checkState', index:'a.check_state', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_check_state')}, val, '${text("未知")}', true);
		}},
		{header:'${text("供应商")}', name:'supplier.supplierFullName', index:'a.supplier_id', width:150, align:"left"},
		{header:'${text("源单号")}', name:'sourceBillNo', index:'a.source_bill_no', width:150, align:"left"},
		{header:'${text("物料名称")}', name:'material.materialName', index:'a.material_name', width:150, align:"left"},
		{header:'${text("采购数量")}', name:'buyNumber', index:'a.buy_number', width:150, align:"center"},
		{header:'${text("待检数量")}', name:'waitCheckNumber', index:'a.wait_check_number', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("检验方式")}', name:'checkType', index:'a.check_type', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_check_type')}, val, '${text("未知")}', true);
		}},
		{header:'${text("送货数量")}', name:'sendNumber', index:'a.send_number', width:150, align:"right", formatter: function(val, obj, row, act){
			return js.formatNumber(val, 2, false, ''); // 数值类型格式化 (原始数值, 小数位数, 是否千分位, 默认值，金额情况下设置0.00);
		}},
		{header:'${text("允入数量")}', name:'stockInNumber', index:'a.stock_in_number', width:150, align:"center"},
		{header:'${text("批次")}', name:'batchNumber', index:'a.batch_number', width:150, align:"left"},
		{header:'${text("包装规格")}', name:'packType', index:'a.pack_type', width:150, align:"left"},
		{header:'${text("生产日期")}', name:'productDate', index:'a.product_date', width:150, align:"center"},
		{header:'${text("保质期")}', name:'savedType', index:'a.saved_type', width:150, align:"center"},
		{header:'${text("过期日期")}', name:'passDate', index:'a.pass_date', width:150, align:"center"},
		{header:'${text("生产厂家")}', name:'productMaker', index:'a.product_maker', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('st_product_maker')}, val, '${text("未知")}', true);
		}},
		{header:'${text("部门编码")}', name:'deptCode', index:'a.dept_code', width:150, align:"left"},
		{header:'${text("部门")}', name:'deptName', index:'a.dept_name', width:150, align:"left"},
		{header:'${text("异常描述")}', name:'exceptionDesc', index:'a.exception_desc', width:150, align:"left"},
		{header:'${text("检验描述")}', name:'checkDesc', index:'a.check_desc', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('st:stCheckLog:edit')){ %>
				actions.push('<a href="${ctx}/st/stCheckLog/form?id='+row.id+'" class="btnList" title="${text("编辑进料检验")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/st/stCheckLog/delete?id='+row.id+'" class="btnList" title="${text("删除进料检验")}" data-confirm="${text("确认要删除该进料检验吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	shrinkToFit: false,
	ajaxSuccess: function(data){
		
	}
});
</script>